function V = scriptProjView(Q,project_id)
%script to see how many collections are in a project and how many items are
%in each project
%Q is a struct with Q.key and Q.url

%R0mesh Stanislaus may 2010

%get all the collections from a project with project_id
if isnumeric(project_id)
    project_id = num2str(project_id);
end
try
    %P = projectView(Q, project_id);
    H.project_id = project_id;
    P = selectCommon(Q,'collections',H);
    if size(P,1) == 0
        error('No Project exists. Please if check the id and try again...')
    end
catch
    error('Please Check if project_id exists and try again...')
end
%now get the collection id's
try
    all_collection_ids = {P(:).id};
catch
    all_collection_ids = {P(:).collection_id};
end
try
    all_proj_ids = {P(:).label};
catch
    all_proj_ids = {P(:).name};
end
for k = 1:size(all_collection_ids,2)
    J.collection_id = all_collection_ids{k};
    S = selectCommon(Q,'items',J);
    %S = selectItems(Q, all_collection_ids{k});
    pause(1);
    stmt = ['Collection ID:  ',all_collection_ids{k},'  has  ',...
        num2str(size(S,1)),'  Items in collection. Collection Label: ',all_proj_ids{k}];
    disp(stmt);
end
disp('Done...');
V='Done...';
